﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hive.Core;
using Hive.Bot.Behaviours;

namespace Hive.Bot.Tasks
{
    public class AttackEnemyTask: ITask
    {
        Squad squad;
        Ant ant;
        public AttackEnemyTask(Squad squad)
        {
            this.squad = squad;
        }

        public IEnumerable<int> CalculateEfficiencies(IEnumerable<Ant> ants)
        {
            return squad.CalculateEfficiencies(ants);
        }

        public void Assign(Ant ant)
        {
            this.ant = ant;
            squad.Assign(ant);
        }

        public bool IsAssigned
        {
            get { return ant != null; }
        }

        public Order Execute()
        {
            return squad.Execute(ant);
        }
    }
}
